using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using LAMSDK.Security.Entities;

namespace LAMSDK.Security.Mapping
{
	public class PostMap : EntityTypeConfiguration<Post>
	{
		public PostMap()
		{
			// Primary Key
			this.HasKey(t => t.PostId);

			// Properties
			this.Property(t => t.PostCode)
				.IsFixedLength()
				.HasMaxLength(10);
				
			this.Property(t => t.PostName)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("Post");
			this.Property(t => t.PostId).HasColumnName("PostId");
			this.Property(t => t.PostCode).HasColumnName("PostCode");
			this.Property(t => t.PostName).HasColumnName("PostName");
		}
	}
}

